package cloud.keveri.gateway.core;

import cloud.keveri.registry.api.InstanceRegisterRepository;
import cloud.keveri.spi.ExtensionLoader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 * 作者：沈自在
 **/
@Configuration
public class RegisterCenterInitializer {

    /**
     *
     */
    @Bean
    public InstanceRegisterRepository instanceRegisterRepository() {
        // 1. 获取 Loader
        ExtensionLoader<InstanceRegisterRepository> extensionLoader = ExtensionLoader.getExtensionLoader(InstanceRegisterRepository.class);

        // 2. 加载默认 (暂时硬编码)
        return extensionLoader.getJoin("nacos");
    }
}
